USE [Training]
GO

IF NOT EXISTS (SELECT * from dbo.sysobjects WHERE id = OBJECT_ID(N'dbo.training_api_SkillSetItemDelete'))
	EXEC('CREATE PROC dbo.training_api_SkillSetItemDelete AS')
GO

ALTER PROC dbo.training_api_SkillSetItemDelete
	@SkillID		int = null,
	@SkillSetID		int
AS
	DELETE FROM Skill_SkillSet
	WHERE
		SkillSetID = @SkillSetID AND
		(@SkillID IS NULL OR(SkillID = @SkillID))
		